flowbox: children per line may not be 0
authorBenjamin Otte <otte@redhat.com>
Sat, 12 Nov 2016 21:57:31 +0000 (22:57 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 15 Nov 2016 16:48:45 +0000 (17:48 +0100)
gtk/gtkflowbox.c

index 26e39c005c5012abd32dc11f5f4bbaacf107d93c..bac2cfa2b7581d12956a0977c6e1fda511387b17 100644 (file)
@@ -3824,7 +3824,7 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
                        P_("Maximum Children Per Line"),
                        P_("The maximum amount of children to request space for "
                           "consecutively in the given orientation."),
-                       0, G_MAXUINT, DEFAULT_MAX_CHILDREN_PER_LINE,
+                       1, G_MAXUINT, DEFAULT_MAX_CHILDREN_PER_LINE,
                        G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
@@ -4621,6 +4621,7 @@ gtk_flow_box_set_max_children_per_line (GtkFlowBox *box,
                                         guint       n_children)
 {
   g_return_if_fail (GTK_IS_FLOW_BOX (box));
+  g_return_if_fail (n_children > 0);
 
   if (BOX_PRIV (box)->max_children_per_line != n_children)
     {